﻿/// <reference path="WorleyNoise.js" />
/// <reference path="SimplexNoise.js" />
/// <reference path="PerlinNoise.js" />
/// <reference path="ValueNoise.js" />
/// <reference path="RandomNoise.js" />

/*
    Name:           SharpNoise
    Description:
                    This library is a noise helper library that provides
                    various different noise functions
    Date: 2014/02/05
    Version: 0.0.1
    Author: Dave Russell 
*/

SharpNoise = new function(){
    "use strict";
    // Basic Noise function
    this.RandomNoise1D = function(x){
        return RandomNoise.Get1D(x);
    };

    this.RandomNoise2D = function (x,y) {
        return RandomNoise.Get2D(x,y);
    };

    this.ValueNoise1D = function (x) {
        return ValueNoise.Get1D(x);             
    };
    

    this.ValueNoise2D = function (x, y) {
        return ValueNoise.Get2D(x,y);       
    };

    this.PerlinNoise1D = function (x) {
        return PerlinNoise.Get1D(x);
    }

    this.PerlinNoise2D = function (x,y) {
        return PerlinNoise.Get2D(x,y);
    }
   
    this.SimplexNoise1D = function (x) {
        return SimplexNoise.Get1D(x);
    }

    this.SimplexNoise2D = function (x,y) {
        return SimplexNoise.Get2D(x,y);
    }

    this.WorleyNoise1D = function (x) {
        return WorleyNoise.Get1D(x);
    }

    this.WorleyNoise2D = function (x, y) {
        WorleyNoise.Seed = 1023;        
        WorleyNoise.CombineDistanceFunction = WorleyNoise.CombineFunction1;
        WorleyNoise.DistanceFunc = WorleyNoise.EuclidianDistanceFunc;
        return WorleyNoise.Get2D(x, y);
    }
    // Utility Functions 
    this.RGBtoHEX = function (r, g, b) {
        var rgb = b | (g << 8) | (r << 16);
        return '#' + rgb.toString(16);
    };
};
